package thread.dn;

/**
 * 守护线程案例分析
 */
public class DaemonThreadDemo01 {
    public static void main(String[] args) {
        System.out.println("创建线程，并设置为守护线程，然后启动线程");
        Thread t = new Thread(
                () -> {
                    while (true) {
                        System.out.println(System.currentTimeMillis());
                    }
                }
        );
        t.setDaemon(true);
        t.start();
    }
}
